package com.ruoyi.web.controller.product;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import static com.ruoyi.common.core.domain.AjaxResult.success;

@RestController
@RequestMapping("/control/product")
public class ProductController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/getTextDataTunnel")
    public AjaxResult getTextDataTunnel(){
        String url = "http://172.16.8.26:8991/productionPlan/productionOperationPlan/getTextDataTunnel";
        Result result = restTemplate.getForObject(url,Result.class);
        return success(result.getData());
    }

    @GetMapping("/getTextDataWorkFace")
    public AjaxResult getTextDataWorkFace(){
        String url = "http://172.16.8.26:8991/productionPlan/productionOperationPlan/getTextDataWorkFace";
        Result result = restTemplate.getForObject(url,Result.class);
        return success(result.getData());
    }
}
